import { defineUniPages } from '@uni-helper/vite-plugin-uni-pages'

export default defineUniPages({
  globalStyle: {
    navigationStyle: 'default',
    navigationBarTitleText: 'unibest',
    navigationBarBackgroundColor: '#f8f8f8',
    navigationBarTextStyle: 'black',
    backgroundColor: '#FFFFFF',
  },
  easycom: {
    autoscan: true,
    custom: {
      // 配置了components.d.ts后，这里可以不配置了
      // '^sar-(.*)': 'sard-uniapp/components/$1/$1.vue',
      '^(?!z-paging-refresh|z-paging-load-more)z-paging(.*)':
        'z-paging/components/z-paging$1/z-paging$1.vue',
      '^sar-(.*)': 'sard-uniapp/components/$1/$1.vue',
      '^gi-(.*)$': '@/components/gi-$1/gi-$1.vue',
    },
  },
  tabBar: {
    // custom: true,
    color: '#C5CAD5',
    selectedColor: '#4C70F0',
    backgroundColor: '#FBFBFB',
    list: [
      {
        pagePath: 'pages/home/index',
        text: '首页',
      },
      {
        pagePath: 'pages/demo/index',
        text: '示例',
      },
      {
        pagePath: 'pages/message/index',
        text: '消息',
      },
      {
        pagePath: 'pages/user/index',
        text: '我的',
      },
    ],
  },
  pages: [
    {
      path: 'pages/home/index',
      type: 'home',
      style: {
        navigationBarTitleText: '首页',
      },
    },
    {
      path: 'pages/demo/index',
      type: 'page',
      style: {
        navigationBarTitleText: '示例',
      },
    },
    {
      path: 'pages/user/index',
      type: 'page',
      style: {
        navigationBarTitleText: '我的',
        navigationBarTextStyle: 'white',
        navigationBarBackgroundColor: '#3049BD',
      },
    },
    {
      path: 'pages/help/index',
      type: 'page',
      style: {
        navigationBarTitleText: '常见问题',
      },
    },
  ],
})
